
package io.zhifei.modules.sys.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import io.zhifei.common.validator.group.AddGroup;
import io.zhifei.common.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 系统用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@Data
@TableName("sys_user")
public class SysUserEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId
    private Long userId;

    @ApiModelProperty("账号")
    private String name;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty("姓名")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = AddGroup.class)
    private String password;

    @ApiModelProperty("部门id")
    private String orgId;

    /**
     * 盐
     */
    private String salt;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty("邮箱")
    private String email;


    /**
     * 手机号
     */
    @ApiModelProperty("电话")
    private String mobile;

    /**
     * 状态  0：禁用   1：正常
     */
    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("性别")
    private Integer sex;

    @ApiModelProperty("生日")
    @TableField("birthday")
    private String birthday;

    @ApiModelProperty("驻守办公室")
    @TableField("work_area")
    private String workArea;

    /**
     * 角色ID列表
     */
    @TableField(exist = false)
    @ApiModelProperty("角色id列表")
    private List<Long> roleIdList;

    @TableField(exist = false)
    @ApiModelProperty("菜单权限列表")
    private List<Long> menuList;

    /**
     * 创建者ID
     */
    @ApiModelProperty("创建者id")
    private Long createUserId;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty(value = "班级ID")
    private Long classId;

    @ApiModelProperty(value = "校区ID，字典编码：CAMPUS（从字典中取）")
    private String camId;

    @ApiModelProperty(value = "校区类型，1：成都，2：重庆")
    @TableField(exist = false)
    private Integer camType;



}
